package com.sakila.mvc.test;

import java.util.Collection;

import org.springframework.context.support.GenericXmlApplicationContext;

import com.sakila.persistence.entities.Language;
import com.sakila.persistence.service.InventoryService;


public class SakilaTestMain {
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
		ctx.load("classpath:sakila-web-context.xml");
		ctx.refresh();
		
		System.out.println("App Context initialized successfully");
		
		InventoryService inventoryService = ctx.getBean("inventoryService", InventoryService.class);
		Collection<Language> langs = inventoryService.findAllLanguages();
		for(Language lang : langs)
			System.out.println(lang.getName());
	}

}
